package com.itheima.thread.utils.cyclibarrier.demo01;

import java.util.concurrent.CyclicBarrier;

public class CyclicBarrierDemo {

    public static void main(String[] args) {

        CyclicBarrier cyclicBarrier = new CyclicBarrier(2);

        CyclicBarrierThread01 cyclicBarrierThread01 = new CyclicBarrierThread01(cyclicBarrier);
        CyclicBarrierThread02 cyclicBarrierThread02 = new CyclicBarrierThread02(cyclicBarrier);

        Thread t1 = new Thread(cyclicBarrierThread01);
        Thread t2 = new Thread(cyclicBarrierThread02);

        t1.start();
        t2.start();



    }
}
